
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Form</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link href="demo.css" rel="stylesheet" type="text/css" />

    
    <script src="scripts/boot.js" type="text/javascript"></script>
    

</head>
<body>
<?php
header("Content-type: text/html; charset=utf-8");
					$data = $_GET['data'];
					$arr = json_decode($data,1);
					$pattern = '/<a href="[^"]*"[^>]*>(.*)<\/a>/'; 
					preg_match_all($pattern, $arr['U_Phone'], $phone);					
					$arr['U_Phone'] = $phone[1][0];

?>
    
       

    <div id="form1" >
        <input name="id" class="mini-hidden" />
        <table>
            
            <tr>
                <td>
                    <label for="textbox1$text">订单号：</label>
                </td>
                <td>
                    <input id="textbox1"  name="U_OrderId" class="mini-textbox" required="true" readonly='readonly' value ="<?php echo $arr['U_OrderId']?>"  />
                </td>
            </tr>
			
			 <tr>
                <td>
                    <label for="textbox1$text">手机：</label>
                </td>
                <td>
                    <input id="textbox1"  name="U_Phone" class="mini-textbox" required="true" value ="<?php echo $arr['U_Phone']?>"/>
                </td>
            </tr>
			
			 <tr>
                <td>
                    <label for="textbox1$text">姓名：</label>
                </td>
                <td>
                    <input id="textbox1"  name="U_Cstname" class="mini-textbox" required="true" value ="<?php echo $arr['U_Cstname']?>"/>
                </td>
            </tr>
			
			 <tr>
                <td>
                    <label for="textbox1$text">发票抬头：</label>
                </td>
                <td>
                    <input id="textbox1"  name="U_InHead" class="mini-textbox" value ="<?php echo $arr['U_InHead']?>"/>
                </td>
            </tr>
             <tr>
                <td>
                    <label for="textbox1$text">发票类型：</label>
                </td>
                <td>
                   <input id="U_InType"   class="mini-combobox" name="U_InType"  textField="text" valueField="id" 
    data='[
		{ "id": "1", "text": "增票" },
		{ "id": "2", "text": "普票" },
		{ "id": "3", "text": "候补" },
		{ "id": "4", "text": "保卡" },
		{ "id": "5", "text": "不开" },
		]'  showNullItem="true" required="true" value ="<?php echo $arr['U_InType']?>" allowInput="true"
    onvalidation="onComboValidation" 
/>  
                </td>
            </tr>
			
			 <tr>
                <td>
                    <label for="textbox1$text">地址：</label>
                </td>
                <td>
                    <input id="textbox1" width='500' name="U_Address" class="mini-textbox"  value ="<?php echo $arr['U_Address']?>"/>
                </td>
            </tr>
			
			 <tr>
                <td>
                    <label for="textbox1$text">优先级：</label>
                </td>
                <td>
                   <input id="U_YXJ"  style='' class="mini-combobox" style="width:150px;" textField="text" valueField="id" 
                     data='[{ "id": "1", "text": "1" },{ "id": "2", "text": "2" },]' value="<?php echo $arr['U_YXJ']?>" showNullItem="true" required="true" allowInput="true" onvalidation="onComboValidation" name='U_YXJ'/> 
                   
                </td>
            </tr>
			
			
			 <tr>
                <td>
                    <label for="textbox1$text">备注：</label>
                </td>
                <td>
                    <input id="textbox1"  name="U_Memo" class="mini-textbox"  value ="<?php echo $arr['U_Memo']?>"/>
                </td>
            </tr>
			<tr>
                <td>
                    
                </td>
                <td>
				    <input value="保存并关闭窗口" type="button" onclick="submitForm(0)" />
                    <input value="保存" type="button" onclick="submitForm(1)" />
                    <input value="取消" type="button" onclick="CloseWindow()" />
                                                          
                    
                </td>
            </tr>
            
        </table>
    </div>
    <script type="text/javascript">
        mini.parse();
        
       
    

      

        function submitForm(tag) {
            

            //提交表单数据
            var form = new mini.Form("#form1");            
            var data = form.getData();      //获取表单多个控件的数据
            var json = mini.encode(data);   //序列化成JSON
			//alert(json);
			
			
           $.ajax({
                url: "/sap/getware.php",
                type: "post",
                data: { data: json },
                success: function (text) {
					if(text>0){
						if(tag==0){
							CloseWindow('ok');
						}else{
							mini.alert('修改成功');
						}
						
					}else{
						mini.alert('修改失败...');
					}
                   
                }
            });

        }
        function loadForm() {
            //加载表单数据
            var form = new mini.Form("#form1");            
            $.ajax({
                url: "../data/FormService.aspx?method=LoadData",
                type: "post",
                success: function (text) {
                    var data = mini.decode(text);   //反序列化成对象
                    form.setData(data);             //设置多个控件数据
                }
            });
        }
		
		  function CloseWindow(action) {
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }

    </script>
    
    

</body>
</html>